package com.epam.parser;

import java.util.ArrayList;
import java.util.List;

public class TextPart {
	String textPart;
	
	public TextPart() {
		
	}
	
	public TextPart(String s) {
		this.textPart = s;
	}
	
	public static String listToString(List<TextPart> part) {
		String s = "";
		for (TextPart t : part) {
			s += t;
		}
		return s;
	}
	
	public String toString() {
		return this.textPart;
	}
	
	public List<String> toStringList(List<TextPart> part) {
		List<String> s = new ArrayList<String>();
		for (TextPart t: part) {
			s.add(t.toString());
		}
		return s;
	}
	
	public static TextPart[] listToArray(List<TextPart> part) {
		TextPart[] parts = new TextPart[part.size()];
		for (int i = 0; i<part.size(); i++) {
			parts[i] = part.get(i);			
		}
		return parts;
	}
	
}